<template>
	<!-- 收款账户申请 -->
	<view class="bank-page">
		<!--标题栏-->
		<bar-title bgColor='bg-white'>
			<block slot="content">收款账户管理</block>
		</bar-title> 
		
		<view class="cu-list menu card-menu margin-top from-info">
			<view class="cu-item">
				<view class="content">
					<text class="title">真实姓名</text>
					<text class="text-gray">{{bankInfo.alipayaname}}</text>
				</view>
			</view>
			<view class="cu-item">
				<view class="content">
					<text class="title">支付宝账号</text>
					<text class="text-gray">{{bankInfo.alipayaccount}}</text>
				</view>
			</view>
		</view>
		
		<view class="cu-list menu card-menu margin-top" 
			@click="jumpTypePages('bankModify')">
			<view class="cu-item">
				<view class="content">
					<text class="text-black" v-if="bankInfo.alipayaname">更改帐户申请</text>
					<text class="text-black" v-else>添加帐户信息</text>
				</view>
				<view class="action">
					<text class="cuIcon-right text-grey pr20"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { User } from '@/models/user.js';
let user = new User()
export default {
	onShow() {
		this.getFaultAccount();
	},
	data() {
		return {
			bankInfo: {}
		}
	},
	methods:{
		jumpTypePages(pageName) {
			
			this.$jumpPages(pageName, {
				...this.bankInfo
			})
		},
		async getFaultAccount() {
			this.bankInfo = await user.getFaultAccount(true);
			console.log(this.bankInfo);
		},
	}
}
</script>

<style lang="scss" scoped>
.from-info{
	.title{
		display: inline-block;
		width: 200rpx;
	}
}
</style>
